package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.AlertDataHandleDto;
import com.zzyl.dto.AlertDataPageQueryDto;
import com.zzyl.service.AlertDataService;
import com.zzyl.vo.AlertDataVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description AlertDataController
 * @Author jun
 * @Date 2025-09-16
 */

@RestController
@RequestMapping("/alert-data")
@Api(tags = "管理端：报警数据相关接口")
public class AlertDataController {

    @Autowired
    private AlertDataService alertDataService;

    @GetMapping("/pageQuery")
    public ResponseResult<PageResponse<AlertDataVo>> pageQuery(AlertDataPageQueryDto alertDataPageQueryDto){

    PageResponse<AlertDataVo> alertDataVoPageResponse = alertDataService.pageAlertData(alertDataPageQueryDto);
    return ResponseResult.success(alertDataVoPageResponse);
    }

    @PutMapping("/handleAlertData/{id}")
    public ResponseResult handleAlertData(AlertDataHandleDto alertDataHandleDto){

        alertDataService.handleAlertData(alertDataHandleDto);
        return ResponseResult.success();

    }

}
